package com.wn.carport.util;

import com.github.pagehelper.PageInfo;
import com.wn.common.pojo.CarPort;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @BelongsProject: shared_parking
 * @BelongsPackage: com.wn.carport.util
 * @Author: 廖刚
 * @CreateTime: 2020-06-22 21:53
 * @Description:
 */
public class PageInfoUtil {

    /**
     * 将carPortList封装成一个map集合
     */
    public static Map<String,Object> List2Map(List<CarPort> carPortList){
        Map<String, Object> map = new HashMap<>();
        PageInfo<CarPort> carPortPageInfo = new PageInfo<>(carPortList);
        if(carPortPageInfo != null){
            map.put("total",carPortPageInfo.getTotal());
            map.put("rows",carPortPageInfo.getList());
        }
        return map;
    }
}
